home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / aie9003.zip / XOR.ARI < prev    next >
Text File  |  1989-12-28  |  3KB  |  71 lines

  1.  
  2. %%%%%%%%%%%% training data for exclusive or %%%%%%%%%%%%%%%%%%%%%%%%%
  3.  
  4. number_data_items( 4 ).
  5.  
  6. % Inputs to net:
  7.   %   data    neuron   value
  8.   %   item    number
  9. input(  0  ,    1,       0 ).
  10. input(  0  ,    2,       0 ).
  11. input(  1  ,    1,       1 ).
  12. input(  1  ,    2,       1 ).
  13. input(  2  ,    1,       1 ).
  14. input(  2  ,    2,       0 ).
  15. input(  3  ,    1,       0 ).
  16. input(  3  ,    2,       1 ).
  17.  
  18. % Desired Outputs from net :
  19.   %   data    neuron   value
  20.   %   item    number
  21. output(  0  ,   9,      0 ).
  22. output(  1  ,   9,      0 ).
  23. output(  2  ,   9,      1 ).
  24. output(  3  ,   9,      1 ).
  25.  
  26. %%%%%%%%%%%% network for exclusive or %%%%%%%%%%%%%%
  27.  
  28.   %%%%%%%%% neuron defintions %%%%%%%%%%%%%%%%
  29.   %       neuron  neuron
  30.   %       type    number   description
  31. neuron(   input ,   1 ,       $A$  ).
  32. neuron(   input ,   2 ,       $B$  ).
  33. neuron(   not(1) ,  3 ,       $-A$  ).
  34. neuron(   not(2) ,  4 ,       $-B$  ).
  35. neuron(   and    ,  5 ,      $A and B$  ).
  36. neuron(   and    ,  6 ,      $A and -B$  ).
  37. neuron(   and    ,  7 ,      $-A and B$  ).
  38. neuron(   and    ,  8 ,      $-A and -B$  ).
  39. neuron(   or     ,  9 ,      $A exc B$  ).
  40.  
  41.  
  42.   %%%%%%%%% edge defintions %%%%%%%%%%%%%%%%
  43.   %    state  type of     sendng receiving
  44.   %    type   receiving   neuron neuron    start  initial
  45.   %           neuron      number number     time  weight
  46. state( edge,  and,          1 ,     5,        0,     1).
  47. state( edge,  and,          2 ,     5,        0,     1).
  48. state( edge,  and,          3 ,     5,        0,     0).
  49. state( edge,  and,          4 ,     5,        0,     0).
  50.  
  51. state( edge,  and,          1 ,     6,        0,     1).
  52. state( edge,  and,          2 ,     6,        0,     0).
  53. state( edge,  and,          3 ,     6,        0,     0).
  54. state( edge,  and,          4 ,     6,        0,     1).
  55.  
  56. state( edge,  and,          1 ,     7,        0,     0).
  57. state( edge,  and,          2 ,     7,        0,     1).
  58. state( edge,  and,          3 ,     7,        0,     1).
  59. state( edge,  and,          4 ,     7,        0,     0).
  60.  
  61. state( edge,  and,          1 ,     8,        0,     0).
  62. state( edge,  and,          2 ,     8,        0,     0).
  63. state( edge,  and,          3 ,     8,        0,     1).
  64. state( edge,  and,          4 ,     8,        0,     1).
  65.  
  66. state( edge,  or ,          5 ,     9,        0,     1).
  67. state( edge,  or ,          6 ,     9,        0,     1).
  68. state( edge,  or ,          7 ,     9,        0,     1).
  69. state( edge,  or ,          8 ,     9,        0,     1).
  70.  
  71.